<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <style>
      body {
        margin: 0;
        padding: 0;
        min-height: 100vh;
        overflow-x: hidden;
      }
      header {
        box-sizing: border-box;
        background: #000;
        width: 100vw;
        height: 44px;
        padding: 0 18px;
      }
      #toggle {
        display: none;
        outline: none;
      }
      .box {
        display: block;
        width: 20px;
        height: 20px;
        position:relative;
        top: 16px;
        cursor: pointer;
      }
      .box span {
        /* position:relative;
        top: 4px;
        left: 4px; */
        display: block;
        height: 1px;
        background: #fff;
        position:relative;
        transition: transform .3s ease-in-out, top .3s ease-in-out .3s;
        top:0;
      }
      .box span:nth-child(2) {
        margin-top: 7px;
      }
      #toggle:checked + label .box span:nth-child(1) {
        transform: rotate(45deg);
        top: 4px;
        transition: top .3s ease-in-out, transform .3s ease-in-out .3s;
      }
      #toggle:checked + label .box span:nth-child(2) {
        transform: rotate(-45deg);
        top: -4px;
        transition: top .3s ease-in-out, transform .3s ease-in-out .3s;
      }
      .menu {
        margin: 0;
        padding:0;
        width: 100vw;
        height: 100vh;
        background: rgba(0, 0, 0, 0.7);
        box-sizing: border-box;
        position:absolute;
        top: 44px;
        left: 0;
        transform: scaleY(0);
        transition: transform .3s ease-in-out .3s,opacity .3s ease-in-out .3s;
        transform-origin: 50% top;
        transition: .4s;
        opacity: 0;
      }
      .menu ul {
        list-style: none;
        padding: 0;
        padding-left: 40px;
        color: #fff;
      }
      .menu ul li {
        line-height: 24px;
      }
      #toggle:checked ~ .menu {
        transform: scaleY(1);
        opacity: 1;
      }
    </style>
  </head>
  <body>
    <header>
      <input id="toggle" type="checkbox" />
      <label for="toggle">
        <div class="box">
          <span></span>
          <span></span>
        </div>
      </label>
      <div class="menu"> 
        <ul>
          <li>首页</li>
          <li>内容</li>
          <li>详情</li>
          <li>具体</li>
          <li>其他</li>
        </ul>
      </div>
     
    </header>
  </body>
</html>
